<?php


namespace app\common\helper\util;


class ApiDoc
{
    static function genClass($class){
        $class = new \ReflectionClass($class);
        $methods = $class->getMethods();
        $list = [];
        array_walk($methods,function(\ReflectionMethod $item)use(&$list,$class){
            if($item->class == $class->name ){
                $list[] = [
                    "doc"=> "\n    ".$item->getDocComment(),
                    "name"=>$item->name,
                    "class"=>$item->class,
                ];
            }
        });
        return $list;
    }
}